// priority: 0
//ctrl + alt + c / l
/**
 * 部分贴图来源阿里素材库：https://www.iconfont.cn/
 */

console.info('Hello, World! (You will only see this line once in console, during startup)')

onEvent('item.modification', event => {
	event.modify('forbidden_arcanus:orb_of_temporary_flight', item => {
		item.maxStackSize = 64
		item.fireResistant = true
	})
	event.modify('projectred-core:draw_plate', item => {
		item.maxStackSize = 64
		item.fireResistant = true
	})

	event.modify('mekanism:upgrade_speed', item => {
		item.maxStackSize = 64
		item.fireResistant = true
	})

	event.modify('mekanism:upgrade_energy', item => {
		item.maxStackSize = 64
		item.fireResistant = true
	})

})

onEvent('block.modification', event => {
	event.modify('minecraft:end_portal_frame', block => {
		block.destroySpeed = 40
	})
})

onEvent('item.registry', event => {
	// Register new items here
	event.create('polluted_dust').burnTime(50);
	event.create('black_debris_debris').displayName('Black Debris Debris');
	event.create('orange_debris_debris').displayName('Orange Debris Debris');
	//粗制水晶锭
	event.create('coarse_crystal_ingot').displayName('Coarse Crystal Ingot');
	//粗制水晶镐
	event.create('rough_crystal_pickaxe').displayName('rough_crystal_pickaxe').type('pickaxe').tier('stone').maxDamage(100);
	event.create('rough_crystal_sword').displayName('rough_crystal_sword').type('sword').tier('stone').maxDamage(100);
	event.create('rough_crystal_axe').displayName('rough_crystal_axe').type('axe').tier('stone').maxDamage(100);
	event.create('rough_crystal_shovel').displayName('rough_crystal_shovel').type('shovel').tier('stone').maxDamage(100);
	event.create('rough_crystal_hoe').displayName('rough_crystal_hoe').type('hoe').tier('stone').maxDamage(100);

	event.create('party_1_ingot').glow(true).displayName('Party 1 Ingot').food((food) => {
		food.hunger(64).saturation(255);
	}).burnTime(64000);
	event.create('party_2_ingot').glow(true).displayName('Party 2 Ingot').food((food) => {
		food.hunger(128).saturation(255);
	}).burnTime(128000);
	event.create('party_3_ingot').glow(true).displayName('Party 3 Ingot').food((food) => {
		food.hunger(256).saturation(255);
	}).burnTime(256000);
	event.create('party_4_ingot').glow(true).displayName('Party 4 Ingot').food((food) => {
		food.hunger(512).saturation(255);
	}).burnTime(512000);
	event.create('create_ingot').displayName('Create Ingot').food((food) => {
		food.hunger(1024).saturation(255);
	}).burnTime(10000000).maxStackSize(1).glow(true);

	///effect give fafaava minecraft:regeneration 
	///effect give fafaava huahuamagicconverter:radiation_resistance
	///effect give fafaava huahuamagicconverter:complete_resistance


	event.create('post_radionin_1').displayName('post radionin 1').food((food) => {
		food.hunger(0).saturation(0).alwaysEdible().fastToEat().effect("minecraft:regeneration", 600, 0, 1);
	});//100 400 1000
	event.create('post_radionin_2').displayName('post radionin 2').food((food) => {
		food.hunger(0).saturation(0).alwaysEdible().fastToEat().effect("huahuamagicconverter:radiation_resistance", 600, 0, 1);
	});
	event.create('post_radionin_3').displayName('post radionin 3').food((food) => {
		food.hunger(0).saturation(0).alwaysEdible().fastToEat().effect("huahuamagicconverter:complete_resistance", 600, 0, 1);
	});
	event.create('radionin_1').displayName('radionin 1').food((food) => {
		food.hunger(0).saturation(0).alwaysEdible().fastToEat().effect("minecraft:regeneration", 600, 0, 1);
	});
	event.create('radionin_2').displayName('radionin 2').food((food) => {
		food.hunger(0).saturation(0).alwaysEdible().fastToEat().effect("huahuamagicconverter:radiation_resistance", 600, 0, 1);
	});
	event.create('radionin_3').displayName('radionin 3').food((food) => {
		food.hunger(0).saturation(0).alwaysEdible().fastToEat().effect("huahuamagicconverter:complete_resistance", 600, 0, 1);
	});

	event.create('reform_counter').displayName('reform_counter'); // 盖革计数器


	event.create('softclay_cake').displayName('soft_clay_cake').food((food) => {
		food.hunger(2).saturation(1).effect('minecraft:nausea', 1, 1, 1.0);
	});

	event.create('softclay_cake_1').displayName('soft_clay_cake_ripe').food((food) => {
		food.hunger(2.5).saturation(1).effect('minecraft:nausea', 1, 1, 1.0);
	});

	event.create('softclay_cake_2').displayName('soft_clay_cake_ripe_gold').food((food) => {
		food.hunger(3.5).saturation(1).effect('minecraft:nausea', 1, 1, 1.0);
	});

	event.create('softclay_cake_3').displayName('soft_clay_cake_ripe_gold_magic').food((food) => {
		food.hunger(4.5).saturation(1).effect('minecraft:nausea', 1, 1, 1.0);
	});

	event.create('softclay_cake_4').displayName('soft_clay_cake_ripe_gold_magic_enchantment').food((food) => {
		food.hunger(5.5).saturation(1).effect('minecraft:nausea', 1, 1, 1.0);
	}).glow(true);

	event.create('softclay_cake_5').displayName('soft_clay_cake_ripe_gold_magic_enchantment_rainbow').food((food) => {
		food.hunger(6.5).saturation(1).effect('minecraft:nausea', 1, 1, 1.0);
	}).glow(true);

	event.create('softclay_cake_6').displayName('soft_clay_scorched').food((food) => {
		food.hunger(-1).saturation(-1).effect('minecraft:nausea', 1, 1, 1.0);
	}).burnTime(100000);


	event.create('polluted_dust_module').displayName('Polluted Dust Module');
	event.create('transaction_money').displayName('Transaction Money');


	event.create('plastic_steel_ingot').displayName('Plastic Steel Ingot');


	event.create('aquamarine_ingot').displayName('Aquamarine Ingot');
	event.create('stabilizing_unit').displayName('Stabilizing Unit');
	event.create('infusion_ingot').displayName('Infusion Ingot');
	event.create('summon_blaze').displayName('Summon Blaze');
	event.create('item_1').displayName("Ast WXQ Construction Apply");
	event.create('item_2').displayName("Assembly Magic Machine Construction Apply");
	event.create('item_3').displayName("Ast Infuser Construction Apply");
	event.create('item_4').displayName("Ast Altar Construction Apply");
	event.create('item_5').displayName("Crystal Planter Construction Apply");

	event.create('summon_blizz').displayName('Summon Blizz');
	event.create('summon_blitz').displayName('Summon Blitz');
	event.create('summon_basalz').displayName('Summon Basalz');

	event.create('item_9').displayName("Mek Basic Fission Reactor Construction Apply");
	event.create('item_10').displayName("Mek Basic Industrial Turbine Construction Apply");
	event.create('item_11').displayName("Mek Basic sps Construction Apply");
	event.create('item_12').displayName("Mek Thermoelectric Boiler Construction Apply");
	event.create('item_13').displayName("Foundation Construction Apply");
	event.create('item_14').displayName("Grinding Tower Construction Apply");
	event.create('item_15').displayName("Hephaestus Construction Apply");
	event.create('item_16')
	event.create('item_17')
	event.create('item_117')
	event.create('item_118')
	event.create('item_119')


	event.create('undead_mixture').displayName('Undead Mixture').food((food) => {
		food.hunger(-20);
	});

	event.create('bombadil').displayName('spirit bombadil');
	event.create('fus').displayName('spirit fus');
	event.create('jita').displayName('spirit jita');
	event.create('tano').displayName('spirit tano');
	event.create('tzeentch').displayName('spirit tzeentch');
	event.create('zod').displayName('spirit zod');





	//event.create('primary_dust').displayName('primary dust').glow(true);




	event.create('item_18').displayName('spirit rune')

	event.create('item_19').displayName('inspiration')
	event.create('item_20').displayName('inspiration II')
	//奥数核心处理器 星纹导能环 灵巧咒术臂 魔力脉冲引擎 元素融合矩阵 咒语编织库 灵魂共振调节器 星能蓄能水晶 
	event.create('item_21').displayName('Arcane Core Processor')


	event.create('item_22').displayName('Stellar Rune Coil')
	event.create('item_23').displayName('Ethereal Spell-Arm')
	event.create('item_24').displayName('Mana Pulse Engine')

	event.create('item_25').displayName('Stellar Rune Coil MKII')
	event.create('item_26').displayName('Ethereal Spell-Arm MKII')
	event.create('item_27').displayName('Mana Pulse Engine MKII')

	event.create('item_28').displayName('Star energy storage crystal').glow(true)






	//知识点
	//星辰启迪

	event.create('paper_1').displayName("soul inspiration")
	event.create('paper_2').displayName("sky inspiration")
	event.create('paper_3').displayName("curse inspiration")
	event.create('paper_4').displayName('obduction inspiration')
	event.create('paper_5').displayName('botania inspiration')
	event.create('paper_6')
	event.create('paper_7')
	event.create('paper_8')
	event.create('paper_9')
	event.create('paper_10')


	//星图

	event.create('paper_a_0').displayName("evorsio") //解离
	event.create('paper_a_1').displayName("aevitas") //生息
	event.create('paper_a_2').displayName("vicio") //虚域
	event.create('paper_a_3').displayName("fornax") //天炉
	event.create('paper_a_4').displayName("octans") //南极
	event.create('paper_a_5').displayName("bootes") //牧夫
	event.create('paper_a_6').displayName("mineralis") //晶金
	event.create('paper_a_7').displayName("horologium") //时钟


	event.create('paper_foredawn').displayName("paper foredawn") //拂晓
	event.create('paper_daytime').displayName("paper daytime") //日昼
	event.create('paper_night').displayName("paper daytime") //黑夜

	event.create("disorderdebris_1").displayName("Disorder Debris I")
	event.create("disorderdebris_2").displayName("Disorder Debris II")
	event.create("disorderdebris_3").displayName("Disorder Debris III")
	event.create("disorderdebris_4").displayName("Disorder Debris IV")
	event.create("disorderdebris_5").displayName("Disorder Debris V")
	event.create("disorderdebris_6").displayName("Disorder Debris VI")
	event.create("disorderdebris_7").displayName("Disorder Debris VII")
	event.create("disorderdebris_8").displayName("Disorder Debris VIII")
	event.create("disorderdebris_9").displayName("Disorder Debris IX")



	//来自绿野仙踪大佬补充的更大的地基
	event.create('add_1_1').displayName("Changed Construction Apply 1x1")
	event.create('add_1_2').displayName("Changed Construction Apply 2x2")
	event.create('add_1_3').displayName("Changed Construction Apply 3x3")


	//添加碎冰 锑粉 氢氧化钠粉 氧化未知混合物粉
	event.create('ice_shard').displayName("Ice Shard");
	event.create('stibium_dust').displayName("Stibium Dust");
	event.create('hydrogen_peroxide').displayName("Hydrogen Peroxide Dust");
	event.create('unknown_mixture').displayName("Unknown Mixture Dust");
	event.create("soldering_tin_ingot").displayName("Soldering Tin Ingot")


	event.create("smaller_chaos_frag").displayName("smaller chaos frag")


});

onEvent('block.registry', event => {
	// Register new blocks here
	event.create('polluted_dirt').material('iron').hardness(5).displayName('Polluted Dirt');
	event.create('coarse_block').material('iron').hardness(5).displayName('Coarse Crystal Block');



	event.create('stagemachinery_1').material('iron').resistance(114514).hardness(5).displayName('Stage Machinery 1');
	event.create('stagemachinery_2').material('iron').resistance(114514).hardness(5).displayName('Stage Machinery 2');
	event.create('stagemachinery_3').material('iron').resistance(114514).hardness(5).displayName('Stage Machinery 3');
	event.create('stagemachinery_4').material('iron').resistance(114514).hardness(5).displayName('Stage Machinery 4');
	event.create('box').material('iron').hardness(5).displayName('Cryst Alassembly Package');
	event.create('box_1').material('iron').hardness(5).displayName('Mineral assembly package');
	event.create('box_2').material('iron').hardness(5).displayName('Electric arc furnace package');
	event.create('box_3').material('iron').hardness(5).displayName('Shredder pack');
	event.create('box_4').material('iron').hardness(5).displayName('Metal punching pack');
	event.create('box_5').material('iron').hardness(5).displayName('Pack_5');
	event.create('box_6').material('iron').hardness(5).displayName('Pack_6');
	event.create('box_7').material('iron').hardness(5).displayName('Pack_7');

	event.create('titaniumalloy_plate').material('iron').hardness(5).resistance(114514).displayName('titanium_alloy_plate');

	event.create('compressed_marble').material('iron').hardness(5).displayName('Compressed Marble');

	event.create('starmetal_frame').material('iron').hardness(5).displayName("Starmetal Frame");
	event.create('magicinfused_alumicube').material('iron').hardness(5).displayName("Magic Infused Alumicube");


	event.create('stardust_block').material('iron').hardness(5).displayName("Stardust Block");


	event.create('pixie_block').material('iron').hardness(5).displayName('Pixie Block');
	// event.create('block_3').material('iron').hardness(5);
	// event.create('block_4').material('iron').hardness(5);

	event.create('auroral_ringinnerwall')
		.material('iron')
		.resistance(114514)
		.hardness(5)
		.lightLevel(1)
		.displayName('Auroral ring constrains inner wall');

	event.create('aurora_ringrestraintglass')
		.material('iron')
		.resistance(114514)
		.hardness(5)
		.lightLevel(1)
		.opaque(true)
		.renderType('translucent')
		.displayName('Aurora ring restraint glass');



});

onEvent('fluid.registry', event => {
	event.create("chaotic_liquid")
		.displayName("chaotic").bucketColor(0x696969).textureThick(0x696969).textureThin(0x696969).viscosity(114514).temperature(114514000);
	event.create("aquamarine_liquid")
		.displayName("aquamarine").bucketColor(0x00FFFF).textureThick(0x00FFFF).textureThin(0x00FFFF);

	event.create("blazing_pyrotheum")
		.displayName("Blazing Pyrotheum").bucketColor(0xFF8C00).textureThick(0xFF8C00).textureThin(0xFF8C00).temperature(3000);

	event.create("gelid_cryotheum")
		.displayName("Gelid Cryotheum").bucketColor(0x0000CD).textureThick(0x0000CD).textureThin(0x0000CD).temperature(-3000);

	event.create("tectonic_petrotheum")
		.displayName("Tectonic Petrotheum").bucketColor(0x8A2BE2).textureThick(0x8A2BE2).textureThin(0x8A2BE2);

	event.create("zephyrean_aerotheum")
		.displayName("Zephyrean Aerotheum").bucketColor(0xFFFACD).textureThick(0xFFFACD).textureThin(0xFFFACD);

	event.create("dirt_liquid")
		.displayName("Dirt Liquid").bucketColor(0x5C3317).textureThick(0x5C3317).textureThin(0x5C3317);


	event.create("uu_substance")
		.displayName("UU Substance").bucketColor(0x8A2BE2).textureThick(0x8A2BE2).textureThin(0x8A2BE2);


	//低纯度裂变溶液
	event.create("lowdensitycrystalline_fluid")
		.displayName("Low Density Crystalline Fluid").bucketColor(0x8A2BE2).textureThick(0x8A2BE2).textureThin(0x8A2BE2);
	// 乙醚
	event.create("diethyl_ether")
		.displayName("Diethyl Ether").bucketColor(0xFFF8DC).textureThick(0xFFF8DC).textureThin(0xFFF8DC);
	// 五氯化锑  antimony pentachloride
	event.create("antimony_pentachloride")
		.displayName("Antimony Pentachloride").bucketColor(0xFFF8DC).textureThick(0xFFF8DC).textureThin(0xFFF8DC);
	//p-507
	event.create("p507")
		.displayName("P-507").bucketColor(0x00FF00).textureThick(0x00FF00).textureThin(0x00FF00);

		
	//焊锡
	event.create("soldering_tin")
		.displayName("Soldering Tin").bucketColor(0xE8FFFF).textureThick(0xE8FFFF).textureThin(0xE8FFFF);

	// 	//氟锑酸
	// event.create("fluoroantimonic_acid")
	// 	.displayName("Fluoroantimonic Acid").bucketColor(0x00FF00).textureThick(0x00FF00).textureThin(0x00FF00);


});

onEvent('gas.registry', event => {
	event.create("test_gas").color(2033667).texture("kubejs:gases/test_gas_texture.png").displayName("Rare metal emulsion")

	event.create("test_gas1").color(602147).texture("kubejs:gases/test_gas_texture.png").displayName("Silica emulsion")
	event.create("test_gas2").color(10027199).texture("kubejs:gases/test_gas_texture.png").displayName("UU")
	event.create("test_gas3").color(602147).texture("kubejs:gases/test_gas_texture.png")
})

onEvent('infuse_type.registry', event => {
	event.create("test_infuse_type").color(13319679)
})


//禁用无限水
onForgeEvent('net.minecraftforge.event.world.BlockEvent$CreateFluidSourceEvent',
	event => {
		//console.log(event.getState().func_204520_s());
		//event.getState().getFluidState().getFluid();，getFluidState()的SCG name为func_204520_s()，
		let a = String(event.getState().func_204520_s()).indexOf("WaterFluid");
		if (a > 0) {
			event.setResult(event.getResult().DENY);
		}

		/*
		public static void onFluidPlaceBlockEvent(BlockEvent.CreateFluidSourceEvent event) {
			Fluid fluid = event.getState().getFluidState().getFluid();
			if(fluid.equals(Fluids.WATER))
				event.setResult(Event.Result.DENY);
		}
		*/
	}
);